﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="Report">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="EmptyResult">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Message" type="xs:string" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="Group">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Title">
                <xs:complexType>
                  <xs:sequence>
                    <xs:choice maxOccurs="unbounded">
                      <xs:element name="Label">
                        <xs:complexType>
                          <xs:attribute name="class" type="xs:string" use="required" />
                          <xs:attribute name="fieldName" type="xs:string" use="required" />
                        </xs:complexType>
                      </xs:element>
                      <xs:element name="Text" type="xs:string" />
                    </xs:choice>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="ItemTemplate" minOccurs="1" maxOccurs="1">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="Column">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="Group">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element name="HeaderTemplate">
                                  <xs:complexType>
                                    <xs:sequence>
                                      <xs:element maxOccurs="unbounded" name="Column">
                                        <xs:complexType>
                                          <xs:sequence>
                                            <xs:element name="Text">
                                              <xs:complexType>
                                                <xs:attribute name="value" type="xs:string" use="required" />
                                              </xs:complexType>
                                            </xs:element>
                                          </xs:sequence>
                                          <xs:attribute name="style" type="xs:string" use="optional" />
                                        </xs:complexType>
                                      </xs:element>
                                    </xs:sequence>
                                  </xs:complexType>
                                </xs:element>
                                <xs:element name="ItemTemplate">
                                  <xs:complexType>
                                    <xs:sequence>
                                      <xs:element maxOccurs="unbounded" name="Column">
                                        <xs:complexType>
                                          <xs:sequence>
                                            <xs:element name="Field">
                                              <xs:complexType>
                                                <xs:attribute name="class" type="xs:string" use="required" />
                                                <xs:attribute name="value" type="xs:string" use="required" />
                                                <xs:attribute name="format" type="xs:string" use="optional" />
                                              </xs:complexType>
                                            </xs:element>
                                          </xs:sequence>
                                          <xs:attribute name="style" type="xs:string" use="required" />
                                        </xs:complexType>
                                      </xs:element>
                                    </xs:sequence>
                                  </xs:complexType>
                                </xs:element>
                                <xs:element name="FooterTemplate">
                                  <xs:complexType>
                                    <xs:sequence>
                                      <xs:element maxOccurs="unbounded" name="Column">
                                        <xs:complexType>
                                          <xs:sequence>
                                            <xs:element minOccurs="0" name="Sum">
                                              <xs:complexType>
                                                <xs:attribute name="class" type="xs:string" use="required" />
                                                <xs:attribute name="fieldName" type="xs:string" use="required" />
                                                <xs:attribute name="format" type="xs:string" use="required" />
                                              </xs:complexType>
                                            </xs:element>
                                            <xs:element minOccurs="0" name="Count">
                                              <xs:complexType>
                                                <xs:attribute name="class" type="xs:string" use="required" />
                                                <xs:attribute name="fieldName" type="xs:string" use="required" />
                                              </xs:complexType>
                                            </xs:element>
                                            <xs:element minOccurs="0" name="Text">
                                              <xs:complexType>
                                                <xs:attribute name="value" type="xs:string" use="required" />
                                              </xs:complexType>
                                            </xs:element>
                                          </xs:sequence>
                                          <xs:attribute name="style" type="xs:string" use="optional" />
                                        </xs:complexType>
                                      </xs:element>
                                    </xs:sequence>
                                  </xs:complexType>
                                </xs:element>
                              </xs:sequence>
                              <xs:attribute name="GroupByClass" type="xs:string" use="required" />
                              <xs:attribute name="GroupByField" type="xs:string" use="required" />
                              <xs:attribute name="Title" type="xs:string" use="required" />
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
            <xs:attribute name="GroupByClass" type="xs:string" use="required" />
            <xs:attribute name="GroupByField" type="xs:string" use="required" />
          </xs:complexType>
        </xs:element>
        <xs:element name="Data">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="ResultSet">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="DataTable">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="DataItems">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element maxOccurs="unbounded" name="DataItem">
                                  <xs:complexType>
                                    <xs:sequence>
                                      <xs:element maxOccurs="unbounded" name="Field">
                                        <xs:complexType>
                                          <xs:simpleContent>
                                            <xs:extension base="xs:string">
                                              <xs:attribute name="type" type="xs:string" use="required" />
                                              <xs:attribute name="name" type="xs:string" use="required" />
                                              <xs:attribute name="class" type="xs:string" use="required" />
                                            </xs:extension>
                                          </xs:simpleContent>
                                        </xs:complexType>
                                      </xs:element>
                                      <xs:element name="DataTable">
                                        <xs:complexType>
                                          <xs:sequence>
                                            <xs:element name="DataItems">
                                              <xs:complexType>
                                                <xs:sequence>
                                                  <xs:element maxOccurs="unbounded" name="DataItem">
                                                    <xs:complexType>
                                                      <xs:sequence>
                                                        <xs:element maxOccurs="unbounded" name="Field">
                                                          <xs:complexType>
                                                            <xs:simpleContent>
                                                              <xs:extension base="xs:string">
                                                                <xs:attribute name="type" type="xs:string" use="required" />
                                                                <xs:attribute name="name" type="xs:string" use="required" />
                                                                <xs:attribute name="class" type="xs:string" use="required" />
                                                              </xs:extension>
                                                            </xs:simpleContent>
                                                          </xs:complexType>
                                                        </xs:element>
                                                      </xs:sequence>
                                                    </xs:complexType>
                                                  </xs:element>
                                                </xs:sequence>
                                              </xs:complexType>
                                            </xs:element>
                                          </xs:sequence>
                                          <xs:attribute name="name" type="xs:string" use="required" />
                                        </xs:complexType>
                                      </xs:element>
                                    </xs:sequence>
                                  </xs:complexType>
                                </xs:element>
                              </xs:sequence>
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                        <xs:attribute name="name" type="xs:string" use="required" />
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                  <xs:attribute name="RecordCount" type="xs:unsignedByte" use="required" />
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>